<form class="layui-form layui-box modal-form-box" action="{:request()->url()}" data-auto="true" method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">头像（png,jpg类型文件）</label>
        <div class="layui-input-block">
            <input type="hidden" name="head_img" value="{$vo.head_img|default=''}">
            <script>$('[name=head_img]').uploadOneImage()</script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">教练名字</label>
        <div class="layui-input-block">
            <input type="text" name="coach_name" value='{$vo.coach_name|default=""}' required="required" title="请输入教练名字" placeholder="请输入教练名字" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">教练年龄</label>
        <div class="layui-input-block">
            <input type="text" name="age" value='{$vo.age|default=""}' required="required" title="请输入教练年龄" placeholder="请输入教练年龄" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">性别</label>
        <div class="layui-input-block">
            <select name='sex' class='layui-select full-width' lay-ignore>

                <option selected value='1'>男</option>
                <option value='2'>女</option>

            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">教练电话</label>
        <div class="layui-input-block">
            <input type="text" name="phone" value='{$vo.phone|default=""}' required="required" title="请输入教练电话" placeholder="请输入教练电话" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">教练描述</label>
        <div class='col-sm-8'>
            <textarea name="description">{$vo.description|default=''|htmlspecialchars_decode}</textarea>
        </div>
    </div>
    <div class="hr-line-dashed"></div>

    <div class="layui-form-item text-center">
        {if isset($vo['id'])}<input type='hidden' value='{$vo.id}' name='id'>{/if}
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>

</form>
<script>
    require(['jquery', 'ckeditor', 'angular'], function () {
        window.form.render();
        window.createEditor('[name="description"]', {height: 500});
    });
</script>
